package com.leijie.io.decorator;

/**
 * @author LeiJie
 * @time 2020-5-8 15:01
 * @desc 装饰模式演示
 * java io的设计模 装饰模式的实现
 */
public class Test {

    public static void main(String[] args) {
        //只有一个麻醉师
        Persion persion = new Anesthetist();
        persion.doSomeThing();
        System.out.println();
        //麻醉师需要一个医生
        Persion persion2 = new Doctor(new Anesthetist());
        persion2.doSomeThing();
        System.out.println();
        //麻醉师需要一个医生还需要一个护士
        Persion persion3 = new Nurse(new Doctor(new Anesthetist()));
        persion3.doSomeThing();
        System.out.println();
    }
}
